/**
 * Created by lenovo on 2017/5/2.
 */
(function($) {
	//页面的高度
	parent.$('#content').css('height', '1000px').css('width', '960px');

	//分页插件
/*	$('#pageToobar').Paging({
		pagesize: 10,
		count: 85,
		toolbar: true
	});*/

 $('#date-range3').dateRangePicker({
		startOfWeek: 'monday',
		separator: ' - ',
		format: 'YYYY.MM.DD',
		autoClose: false,
		time: {
			enabled: false
		},
	}).bind('datepicker-apply', function(event, obj) {
	
		/* This event will be triggered when user clicks on the apply button */
		console.log(obj);
	});
//	clubId=1&page=0&count=10&startDate=1451577600000&endDate=1501516800002
	function getRecord(page,size,startDate,endDate,callback){
		$.getJSON(config.baseUrl+"/operate/getOperateLogs",{clubId:clubId,page:page,count:size,startDate:startDate,endDate:endDate},function(data){
			callback(data);
		})
	}
		
	var clubId=1;
	var pageobj;
	function render(data){
		var html="";
		var str=$("#recordItem").html();
		data.body.forEach(function(item){
			html+=str.replace(/\{nickname\}/,item.operatorNickname)
			.replace(/\{titel\}/,item.operatorIdentity)
			.replace(/\{rank\}/,item.operateDetail)
			.replace(/\{time\}/,item.operatetime)
			.replace(/\{id\}/,item.id)
			
		})
		$(".ul_li1").html(html);
	}
	getRecord(0,10,1451577600000,1501516800002,function(data){
//		console.log(data)
	render(data);
			pageobj=$('#pageToobar').Paging({
		pagesize: 10,
		count: 85,
		toolbar: true
	});
	})
/*	pageobj[0].render({
		current:3,
			count: 90,
	})*/
	

	//操作记录接口
	$.ajax({
		url: '',
		type: '',
		dataType: 'json',
		success: function(result) {

		},
		error: function(result) {
 	
		}
	})
})($)